﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using B.S.XZYData.Domain.BaseEntities;

namespace B.S.XZYData.Domain.XZY
{
    /// <summary>
    /// 销售订单产品明细子表
    /// </summary>
    [SugarTable("SalesOrderProduct")]
    public class SalesOrderProduct
    {
        /// <summary>
        /// 自增主键
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        /// <summary>
        /// 关联销售订单ID（外键）
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public int SalesOrderId { get; set; }

        /// <summary>
        /// 产品编号
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public string ProductCode { get; set; }

        /// <summary>
        /// 产品名称
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public string ProductName { get; set; }

        /// <summary>
        /// 产品规格
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string ProductSpec { get; set; }

        /// <summary>
        /// 工单单编号
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public string WorkOrderNo { get; set; }

        /// <summary>
        /// 订单数量
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public int Quantity { get; set; }

        /// <summary>
        /// 完成数量
        /// </summary>
        [SugarColumn(IsNullable = false, DefaultValue = "0")]
        public int CompletedQuantity { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 创建人ID（关联User.Id）
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public int CreatorId { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public DateTime? ModifyTime { get; set; }

        /// <summary>
        /// 修改人ID（关联User.Id）
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public int? ModifierId { get; set; }
        /// <summary>
        /// 逻辑删除
        /// </summary>
        public bool IsDeleted { get; set; } = false;
    }
}
